/*
 * SinkInfoBO.java 
 * 
 * Copyright 2009 Wangfeng Beijing Inc. 
 * All rights reserved. 
 * 
 * Created on 2012-07-06
 */

package com.bjtech.domain.query;

import java.util.Date;
import com.bjtech.web.util.SelectBean;
import org.ssi.web.util.QuerySpecTpl;

/**
 * 功能概述:散热器信息管理 <br>
 * 
 * @author 王峰
 */

public class SinkInfoQuerySpec extends SelectBean {
	/* */
	private Long id;
	/* */
	private Long sink_no;
	/* */
	private Long join_ft;
	/* */
	private Long type;
	/* */
	private String brand;
	/* */
	private Float sink_height;
	/* */
	private Float sink_width;
	/* */
	private Float sink_length;
	/* */
	private Float sink_cen_dis;
	/* */
	private Float cal_power;
	/* */
	private Long piece_num;
	/* */
	private Float power_factor;
	/* */
	private Float couple_factor;
	/* */
	private Float other_factor;
	/* */
	private Long has_cover;
	/* */
	private Long temp_control;
	/* */
	private Long house_function;
	/* */
	private String install_pic;
	/* */
	private String demo;

	@Override
	public void queryParamString() {
		StringBuilder fromPart = new StringBuilder(" where 1=1");

		if (this.isAll != null && this.isAll.intValue() != 1) {
			if (QuerySpecTpl.isValid(id)) {
				fromPart.append(" and a.id = ");
				fromPart.append(id);
			}

			if (QuerySpecTpl.isValid(sink_no)) {
				fromPart.append(" and a.sink_no = ");
				fromPart.append(sink_no);
			}

			if (QuerySpecTpl.isValid(join_ft)) {
				fromPart.append(" and a.join_ft = ");
				fromPart.append(join_ft);
			}

			if (QuerySpecTpl.isValid(type)) {
				fromPart.append(" and a.type = ");
				fromPart.append(type);
			}

			if (QuerySpecTpl.isValid(brand)) {
				fromPart.append(" and a.brand like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(brand);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(sink_height)) {
				fromPart.append(" and a.sink_height = ");
				fromPart.append(sink_height);
			}

			if (QuerySpecTpl.isValid(sink_width)) {
				fromPart.append(" and a.sink_width = ");
				fromPart.append(sink_width);
			}

			if (QuerySpecTpl.isValid(sink_length)) {
				fromPart.append(" and a.sink_length = ");
				fromPart.append(sink_length);
			}

			if (QuerySpecTpl.isValid(sink_cen_dis)) {
				fromPart.append(" and a.sink_cen_dis = ");
				fromPart.append(sink_cen_dis);
			}

			if (QuerySpecTpl.isValid(cal_power)) {
				fromPart.append(" and a.cal_power = ");
				fromPart.append(cal_power);
			}

			if (QuerySpecTpl.isValid(piece_num)) {
				fromPart.append(" and a.piece_num = ");
				fromPart.append(piece_num);
			}

			if (QuerySpecTpl.isValid(power_factor)) {
				fromPart.append(" and a.power_factor = ");
				fromPart.append(power_factor);
			}

			if (QuerySpecTpl.isValid(couple_factor)) {
				fromPart.append(" and a.couple_factor = ");
				fromPart.append(couple_factor);
			}

			if (QuerySpecTpl.isValid(other_factor)) {
				fromPart.append(" and a.other_factor = ");
				fromPart.append(other_factor);
			}

			if (QuerySpecTpl.isValid(has_cover)) {
				fromPart.append(" and a.has_cover = ");
				fromPart.append(has_cover);
			}

			if (QuerySpecTpl.isValid(temp_control)) {
				fromPart.append(" and a.temp_control = ");
				fromPart.append(temp_control);
			}

			if (QuerySpecTpl.isValid(house_function)) {
				fromPart.append(" and a.house_function = ");
				fromPart.append(house_function);
			}

			if (QuerySpecTpl.isValid(install_pic)) {
				fromPart.append(" and a.install_pic like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(install_pic);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(demo)) {
				fromPart.append(" and a.demo like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(demo);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(this.direction)
					&& QuerySpecTpl.isValid(this.sort)) {
				fromPart.append(" order by ");
				fromPart.append(this.sort);
				fromPart.append(" ");
				fromPart.append(this.direction);
			} else {
				fromPart.append(" order by ");
				fromPart.append("id");
				fromPart.append(" ");
				fromPart.append("asc");

			}
		}
		super.setQueryString(fromPart.toString());
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getSink_no() {
		return this.sink_no;
	}

	public void setSink_no(Long sink_no) {
		this.sink_no = sink_no;
	}

	public Long getJoin_ft() {
		return this.join_ft;
	}

	public void setJoin_ft(Long join_ft) {
		this.join_ft = join_ft;
	}

	public Long getType() {
		return this.type;
	}

	public void setType(Long type) {
		this.type = type;
	}

	public String getBrand() {
		return this.brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public Float getSink_height() {
		return this.sink_height;
	}

	public void setSink_height(Float sink_height) {
		this.sink_height = sink_height;
	}

	public Float getSink_width() {
		return this.sink_width;
	}

	public void setSink_width(Float sink_width) {
		this.sink_width = sink_width;
	}

	public Float getSink_length() {
		return this.sink_length;
	}

	public void setSink_length(Float sink_length) {
		this.sink_length = sink_length;
	}

	public Float getSink_cen_dis() {
		return this.sink_cen_dis;
	}

	public void setSink_cen_dis(Float sink_cen_dis) {
		this.sink_cen_dis = sink_cen_dis;
	}

	public Float getCal_power() {
		return this.cal_power;
	}

	public void setCal_power(Float cal_power) {
		this.cal_power = cal_power;
	}

	public Long getPiece_num() {
		return this.piece_num;
	}

	public void setPiece_num(Long piece_num) {
		this.piece_num = piece_num;
	}

	public Float getPower_factor() {
		return this.power_factor;
	}

	public void setPower_factor(Float power_factor) {
		this.power_factor = power_factor;
	}

	public Float getCouple_factor() {
		return this.couple_factor;
	}

	public void setCouple_factor(Float couple_factor) {
		this.couple_factor = couple_factor;
	}

	public Float getOther_factor() {
		return this.other_factor;
	}

	public void setOther_factor(Float other_factor) {
		this.other_factor = other_factor;
	}

	public Long getHas_cover() {
		return this.has_cover;
	}

	public void setHas_cover(Long has_cover) {
		this.has_cover = has_cover;
	}

	public Long getTemp_control() {
		return this.temp_control;
	}

	public void setTemp_control(Long temp_control) {
		this.temp_control = temp_control;
	}

	public Long getHouse_function() {
		return this.house_function;
	}

	public void setHouse_function(Long house_function) {
		this.house_function = house_function;
	}

	public String getInstall_pic() {
		return this.install_pic;
	}

	public void setInstall_pic(String install_pic) {
		this.install_pic = install_pic;
	}

	public String getDemo() {
		return this.demo;
	}

	public void setDemo(String demo) {
		this.demo = demo;
	}
}
